﻿using System;
using System.Drawing;
using System.Linq;
using System.Reflection;

namespace Axial
{
	public static partial class CallHandler
	{
		[CallHandler(typeof(Color))]
		private static string HandleColor(MethodInfo method, object called, object[] stack)
		{
			// test for color lookup
			if (method.IsStatic)
			{
				string colorName = method.Name.Substring(4);
				Color color = Color.FromName(colorName);
				return "'#" + color.ToArgb().ToString("x").Substring(2) + "'";
			}
			return null;
		}
	}
}
